import { Router } from "vue-router";
import Login from "../Login.vue";
import Register from "../Register.vue";
import { addToRouter } from "@/app/router/addToRouter";
import { loginName, logoutName, registerName, userListName, userTreeName } from "./routesNames";
import UserList from "../UserList.vue";

export function addIdentitiesPages(r:Router){
    addToRouter(r, routes);
}

const routes = [
    {
        path:"/Login/:backAfterSuccess?",
        component:Login,
        props:true,
        name:loginName,
        meta:{title:"登录"}
    },
    {
        path:"/Logout",
        component:Login,
        props:{logoutImmediatly:true},
        name:logoutName
    },
    {
        path:"/Register",
        component:Register,
        name:registerName,
        meta:{title:"注册"}
    },
    {
        path:"/UserList",
        component:UserList,
        props:{type:'list'},
        name:userListName,
        meta:{title:"用户"}
    },
    {
        path:"/UserTree",
        component:UserList,
        props:{type:'tree'},
        name:userTreeName,
        meta:{title:"用户"}
    }
]